<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <ul>
          <li v-for="hobby in hobbys">{{hobby}}</li>
        </ul>

        <ul>
          <li v-for="hobby in newHobbys">{{hobby}}</li>
        </ul>
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: "#app",
        template: "#t1",
        data: {
          hobbys: ["css", "html", "js", "vue", "git", "asp"],
        },
        computed: {
          newHobbys() {
            // return this.hobbys.filter((el) => el.length === 3);
            const arr = [...this.hobbys];
            arr.sort();
            return arr;
          },
        },
      });
    </script>
  </body>
</html>
